#include "BasicDispatcher.h"
#include "FnDispatcher.h"
#include "Shapes.h"
#include "Dispatched.h"

int main()
{ 
	BasicDispatcher<Shape> disp;
	Shape *p1 = new Poly;
	Shape *p2 = new Ellipse;
	Shape *p3 = new Rectangle;
	disp.Add<Rectangle,Rectangle>(Hatch::RectangleRectangle);
	try{
		disp.Go(*p3,*p3);
	}
	catch(std::exception &e) {
		std::cout << e.what() << std::endl;
	}

	FnDispatcher<Shape> fn_disp;
	fn_disp.Add<Ellipse,Poly,Hatch::EllipsePoly,true>();
	try{
		fn_disp.Go(*p2,*p1);
		fn_disp.Go(*p1,*p2);
	}
	catch(std::exception &e) {
		std::cout << e.what() << std::endl;
	}
}